<f:view
		xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:a4j="http://richfaces.org/a4j"
		xmlns:rich="http://richfaces.org/rich"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:itdep="http://itdep.bsuir.by/jsf"
		xmlns:t="http://myfaces.apache.org/tomahawk"
		>
	<ui:decorate template="/facelets/template/mainTemplate.xhtml">
		<ui:define name="title">#{commonBundle.title}</ui:define>
		<ui:define name="center">
			<ui:decorate template="/facelets/template/centerTemplate.xhtml">
				<ui:define name="content">
					<a4j:form>
						<a4j:commandLink value="#{studentBundle.backToList}" action="#{employeeBean.cancel}"
										 reRender="content"
										 immediate="true"/>
					</a4j:form>

					<h:panelGrid columns="2" width="100%"
								 columnClasses="td2,td2" cellspacing="10"
								 cellpadding="0">
						<ui:decorate template="/facelets/template/editSection.xhtml">
							<ui:param name="title" value="#{personBundle.employee}"/>
							<ui:param name="section" value="#{employeeBean.fullNameES}"/>
							<ui:define name="view">
								<div class="graphicImageInList">
									<itdep:personPhoto personPhoto="#{employeeBean.record.personPhoto}"/>
									<itdep:personPhotoEdit personPhoto="#{employeeBean.record.personPhoto}"/>
								</div>
								<h:outputText value="#{employeeBean.record.firstName} "/>
								<h:outputText value="#{employeeBean.record.middleName} "/>
								<h:outputText value="#{employeeBean.record.lastName}"/><br/>
								<h:outputText value="#{personBundle.birthDate}: "/>
								<h:outputText value="#{employeeBean.record.birthDate}">
									<f:convertDateTime pattern="dd.MM.yyyy" timeZone="EET"/>
								</h:outputText>
							</ui:define>
							<ui:define name="edit">
								<ui:decorate template="/facelets/template/person/nameEdit.xhtml">
									<ui:param name="idPrefix" value="employee"/>
									<ui:param name="person" value="#{employeeBean.record}"/>
								</ui:decorate>
							</ui:define>
						</ui:decorate>

						<ui:decorate template="/facelets/template/editSection.xhtml">
							<ui:param name="title" value="#{personBundle.personInfo}"/>
							<ui:param name="section" value="#{employeeBean.personInfoES}"/>
							<ui:define name="view">
								<itdep:personalInfo person="#{employeeBean.record}"/>
							</ui:define>
							<ui:define name="edit">
								<ui:decorate template="/facelets/template/person/personalInfoEdit.xhtml">
									<ui:param name="idPrefix" value="employee"/>
									<ui:param name="person" value="#{employeeBean.record}"/>
									<ui:define name="AdditionalInfo">
										<h:panelGrid columns="3">
											<h:outputText value="#{personBundle.education}" styleClass="requiredField"/>
											<rich:spacer width="20"/>
											<itdep:entitySelectMenu value="#{employeeBean.record.education}"
																	entityType="education"
																	id="#{idPrefix}Education"
																	required="true" format="{i18n.description}"
																	styleClass="sizeCopmonent"/>
											<itdep:errorMessage for="#{idPrefix}Education"/>
										</h:panelGrid>
									</ui:define>
								</ui:decorate>
							</ui:define>
						</ui:decorate>

						<ui:decorate template="/facelets/template/editSection.xhtml">
							<ui:param name="title" value="#{personBundle.passport}"/>
							<ui:param name="section" value="#{employeeBean.identityES}"/>
							<ui:define name="view">
								<itdep:passportInfo passport="#{employeeBean.record.identityCard}"/>
							</ui:define>
							<ui:define name="edit">
								<ui:decorate template="/facelets/template/person/identityCardEdit.xhtml">
									<ui:param name="idPrefix" value="employee"/>
									<ui:param name="identityCard" value="#{employeeBean.record.identityCard}"/>
								</ui:decorate>
							</ui:define>
						</ui:decorate>

						<ui:decorate template="/facelets/template/editSection.xhtml">
							<ui:param name="title" value="#{commonBundle.description}"/>
							<ui:param name="section" value="#{employeeBean.employeeDescriptionES}"/>
							<ui:define name="view">
								<itdep:employeeSpecificInfo employee="#{employeeBean.record}"/>
							</ui:define>
							<ui:define name="edit">
								<ui:decorate template="/facelets/template/person/employeeSpecificEdit.xhtml">
									<ui:param name="idPrefix" value="employee"/>
									<ui:param name="employee" value="#{employeeBean.record}"/>
								</ui:decorate>
							</ui:define>
						</ui:decorate>

						<ui:decorate template="/facelets/template/tableTemplate.xhtml">
							<ui:param name="idPrefix" value="employeeDepartment"/>
							<ui:param name="actionBean" value="#{employeeDepartmentBean}"/>
							<ui:define name="editPanelContext">
								<ui:decorate template="/facelets/template/person/employeeDepartmentEdit.xhtml">
									<ui:param name="idPrefix" value="employeeDepartments"/>
									<ui:param name="record" value="#{employeeDepartmentBean.record}"/>
								</ui:decorate>
							</ui:define>
							<ui:define name="tableContext">
								<rich:column width="30%">
									<f:facet name="header"><h:outputText
											value="#{departmentBundle.department}"/></f:facet>
									<itdep:entityOutput value="#{record.department}" format="{i18n.fullName}"
														locale="#{translationBean.locale}"/>
								</rich:column>
								<rich:column width="30%">
									<f:facet name="header"><h:outputText value="#{personBundle.jobPosition}"/></f:facet>
									<itdep:entityOutput value="#{record.jobPosition}" format="{i18n.description}"
														locale="#{translationBean.locale}"/>
								</rich:column>
							</ui:define>
						</ui:decorate>

						<ui:decorate template="/facelets/template/tableTemplate.xhtml">
							<ui:param name="idPrefix" value="employeeContact"/>
							<ui:param name="actionBean" value="#{contactBean}"/>
							<ui:define name="editPanelContext">
								<ui:decorate template="/facelets/template/person/contactEdit.xhtml">
									<ui:param name="idPrefix" value="employeeContacts"/>
									<ui:param name="record" value="#{contactBean.record}"/>
								</ui:decorate>
							</ui:define>
							<ui:define name="tableContext">
								<rich:column width="30%">
									<f:facet name="header"><h:outputText value="#{personBundle.contactType}"/></f:facet>
									<itdep:entityOutput value="#{record.contactType}" format="{i18n.fullName}"
														locale="#{translationBean.locale}"/>
								</rich:column>
								<rich:column width="61%">
									<f:facet name="header"><h:outputText value="#{personBundle.contact}"/></f:facet>
									<h:outputText value="#{record.contactValue}"/>
									<br/>
								</rich:column>
							</ui:define>
						</ui:decorate>

					</h:panelGrid>

					<h:panelGrid columns="1" width="100%" styleClass="detailsPanelGrid" cellspacing="0" cellpadding="0">
						<ui:decorate template="/facelets/template/tableTemplate.xhtml">
							<ui:param name="anyValue" value="#{anyValue}"/>
							<ui:param name="idPrefix" value="employeeAddress"/>
							<ui:param name="actionBean" value="#{addressBean}"/>
							<ui:define name="editPanelContext">
								<ui:decorate template="/facelets/template/person/addressEditCompact.xhtml">
									<ui:param name="idPrefix" value="employeeAddress"/>
									<ui:param name="address" value="#{addressBean.record}"/>
									<ui:param name="addrBean" value="#{addressBean}"/>
									<ui:param name="addrType" value="true"/>
								</ui:decorate>
							</ui:define>
							<ui:define name="tableContext">
								<rich:column width="1%">
									<f:facet name="header"><h:outputText
											value="#{dictionaryBundle.addressType}"/></f:facet>
									<itdep:entityOutput value="#{record.addressType}" format="{i18n.fullName}"
														locale="#{translationBean.locale}"/>
								</rich:column>
								<rich:column>
									<ui:decorate template="/facelets/template/person/fullAddress.xhtml"/>
								</rich:column>
							</ui:define>
						</ui:decorate>
					</h:panelGrid>


				</ui:define>
			</ui:decorate>
		</ui:define>
	</ui:decorate>

</f:view>